//
//  CodeExchangeResModel.swift
//  koolcar
//
//  Created by xiantian on 2023/11/4.
//

import UIKit
import ObjectMapper

class CodeExchangeResModel: Mappable {
    var code: String?
    var msg: String?
    var data: CouponDataModel?
    
    func mapping(map: Map) {
        code <- map["code"]
        msg <- map["msg"]
        data <- map["data"]
    }
    required init?(map: Map) {
        
    }
}

class CouponDataModel: Mappable {
    var couponName : String?
    var desc : String?
    var giftTypeStr : String?
    var id: NSInteger?
    var reducePrice : Double?
    var useScene : String?
    var errorMsg: String?
    
    //----优惠券列表
    var couponInfo: String?
    var couponType: NSInteger?
    var dateType: NSInteger?
    var description: String?
    var status: NSInteger?
    var validTime: String?
    var urlPicture: String?
    var giftName: String?
    //-----优惠券列表
    
    var isSelect: Bool = false //是否选中
    var selectBlock: (()->Void)? //选中block
    func mapping(map: Map) {
        couponName <- map["couponName"]
        desc <- map["desc"]
        giftTypeStr <- map["giftTypeStr"]
        id <- map["id"]
        reducePrice <- map["reducePrice"]
        useScene <- map["useScene"]
        errorMsg <- map["errorMsg"]
        
        couponInfo <- map["couponInfo"]
        couponType <- map["couponType"]
        dateType <- map["dateType"]
        status <- map["status"]
        validTime <- map["validTime"]
        description <- map["description"]
        urlPicture <- map["urlPicture"]
        giftName <- map["giftName"]
    }
    
    required init?(map: Map) {
        
    }
}
